package com.pcbly.web.components.utils.converters;

import org.apache.commons.beanutils.Converter;
import org.apache.commons.beanutils.converters.IntegerConverter;

public class MyIntConverter implements Converter {
	private static Integer newInt()
    {
        return new Integer(0);
    }
	@SuppressWarnings("unchecked")
    public Object convert(Class type, Object value)
    {
        if(type.equals(Integer.TYPE) && value == null)
            return newInt();
        else
            return (new IntegerConverter()).convert(type, value);
    }
    public MyIntConverter(){
    	
    }

}
